package com.mobilepay.moneypig.model.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

import com.mobilepay.moneypig.R;
import com.mobilepay.moneypig.base.BaseDialog;

/**
 * Created by xlm on 2017/8/2 0002
 */

public class CollectTypeDialog extends BaseDialog implements View.OnClickListener {

    public CollectTypeDialog(Context context) {
        super(context, R.style.CommonDialog_transparent);
    }

    public CollectTypeDialog(Context context, int themeResId) {
        super(context, themeResId);
    }

    protected CollectTypeDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    private LinearLayout mLinearAlipy;
    private LinearLayout mLinearWeixin;
    private LinearLayout mLinearBank;
    private LinearLayout mLinearMore;
    private RelativeLayout mRelativeCancle;
    private RelativeLayout mRelativeDialog;

    @Override
    protected void onSetContentView() {
        setContentView(R.layout.dialog_collect_type);
    }

    @Override
    protected void initViews() {
        mRelativeDialog = (RelativeLayout) findViewById(R.id.dialog_collect);
        mLinearAlipy = (LinearLayout) findViewById(R.id.collect_alipy);
        mLinearWeixin = (LinearLayout) findViewById(R.id.collect_weixin);
        mLinearBank = (LinearLayout) findViewById(R.id.collect_bank);
        mLinearMore = (LinearLayout) findViewById(R.id.collect_more);
        mRelativeCancle = (RelativeLayout) findViewById(R.id.collect_cancle);
        initWindow(1.0f, 0.5f, Gravity.BOTTOM);
        setAnimate(R.style.animatedialog4);
    }

    @Override
    protected void onSetListener() {
        mLinearAlipy.setOnClickListener(this);
        mLinearWeixin.setOnClickListener(this);
        mLinearBank.setOnClickListener(this);
        mLinearMore.setOnClickListener(this);
        mRelativeCancle.setOnClickListener(this);
    }

    @Override
    protected void afterOnCreate(Bundle savedInstanceState) {

    }

    private Listener listener;

    public void setListener(Listener listener) {
        this.listener = listener;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.collect_alipy:
                listener.onSelectAlipy();
                break;
            case R.id.collect_weixin:
                listener.onSelectWeixin();
                break;
            case R.id.collect_bank:
                listener.onSelectBank();
                break;
            case R.id.collect_more:
                listener.onSelectMore();
                break;
            case R.id.collect_cancle:
                dismiss();
                break;
        }
    }

    public static class Listener {
        public void onSelectAlipy() {

        }

        public void onSelectWeixin() {

        }

        public void onSelectBank() {

        }

        public void onSelectMore() {
        }
    }
}
